<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 只能选亲儿子 叫亲儿子选择器*/
        div>p {
            color: darkmagenta;
        }

        /* 这样写没有用，颜色没有变 */
        div>p>h4 {
            color: darkturquoise;
        }

        div>h4 {
            color: #ec27c2;
        }

        div>p>span>a {
            color: pink;
        }
    </style>
</head>

<body>
    <div>
        <p>亲儿子</p>
        <p>
        <h4>孙子</h4>
        </p>
        <p>
            <span>
                <a href="#">我是孙子</a>
            </span>
        </p>

    </div>
</body>

</html>